﻿//  Symplectic Spark
//  Copyright 2010 Symplectic Ltd
//  Created by Martyn Whitwell (martyn@symplectic.co.uk)

//  This file is part of Spark.

//  Spark is free software: you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation, either version 3 of the License, or
//  (at your option) any later version.

//  Spark is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.

//  You should have received a copy of the GNU General Public License
//  along with Spark.  If not, see <http://www.gnu.org/licenses/>.

// $URL: https://symplectic-spark.googlecode.com/svn/trunk/website/App_Code/Component.cs $
// $LastChangedDate: 2010-03-03 13:06:53 +0000 (Wed, 03 Mar 2010) $
// $LastChangedRevision: 15 $
// $LastChangedBy: martyn@symplectic.co.uk $

using System;
using System.Configuration;

using Symplectic.Spark;

namespace Symplectic.Spark
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("This program reindexes the Spark userfeed");

            string apiBaseUrl = ConfigurationSettings.AppSettings["api-base-url"];
            string indexDirectory = ConfigurationSettings.AppSettings["index-directory"];

            Console.WriteLine("API Url: " + apiBaseUrl);
            Console.WriteLine("Index Directory: " + indexDirectory);


            HackedUserFeed huf = new HackedUserFeed(indexDirectory, apiBaseUrl);

            Console.WriteLine("Updated {0} users", huf.UpdateUsersFromAPI());


            Console.WriteLine("All done");
        }
    }
}
